package com.factory.test.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.factory.test.util.DataSaveUtil;
import com.factory.test.main.MainActivity;


/**
 * 开机自启广播
 */
public class BootBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("TAG", "重启");
        if(DataSaveUtil.getInstance().isRurn()){    //如果是烧录了, 则进入主界面
            Log.d("TAG", "重启11");
            DataSaveUtil.getInstance().saveBurn(false);
            Intent start = new Intent(context, MainActivity.class);
            start.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(start);
        }
    }
}
